package net.wofly.sale.report.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wofly.common.util.Identities;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 销售库存汇总日报
 *
 * @author lign
 * @version 1.0
 * @created 09-4月-2018 22:42:33
 */
@Data
@Entity
@Table(name = "sale_report_salestockdailyreport")
@ApiModel(description = "销售库存汇总日报")
public class SaleStockDailyReport {
    @Id
    private String saleStockDailyReportID;
    
    /**
     * 领料申请数量
     */
    @ApiModelProperty(value = "领料申请数量")
    private Integer ask;
    /**
     * 终端商品ID
     */
    @ApiModelProperty(value = "终端商品ID")
    private String commodityTerminalID;

    /**
     * 终端商品名称
     */
    @ApiModelProperty(value = "终端商品名称")
    private String commodityTerminalName;
    
    @ApiModelProperty(value = "汇总日期")
    private Long countDate;
    /**
     * 历史库存数量
     */
    @ApiModelProperty(value = "历史库存数量")
    private Integer hisStock;
    
    private Long modifyDate;
    /**
     * 销售数量
     */
    @ApiModelProperty(value = "销售数量")
    private Integer sale;
    
    private String saleDailyReportID;
    
    /**
     * 当前库存
     */
    @ApiModelProperty(value = "当前库存")
    private Integer stock;
    /**
     * 被汇总业务经理ID
     */
    @ApiModelProperty(value = "被汇总业务经理ID")
    private String userID;
    
    @ApiModelProperty(value = "被汇总业务经理姓名")
    private String userName;
    
    public SaleStockDailyReport() {
    
    }

    public SaleStockDailyReport(Integer ask, String commodityTerminalID, String commodityTerminalName, Long countDate, String userID, String userName) {
        this.ask = ask;
        this.commodityTerminalID = commodityTerminalID;
        this.commodityTerminalName = commodityTerminalName;
        this.countDate = countDate;
        this.userID = userID;
        this.saleStockDailyReportID = Identities.uuid2();
        this.sale = 0;
        this.hisStock = 0;
        this.modifyDate = System.currentTimeMillis();
        this.stock = 0;
        this.userName = userName;
    }

    public SaleStockDailyReport(String commodityTerminalID, Integer hisStock, String commodityTerminalName, Long countDate, String userID) {
        this.saleStockDailyReportID = Identities.uuid2();
        this.ask = 0;
        this.commodityTerminalID = commodityTerminalID;
        this.commodityTerminalName = commodityTerminalName;
        this.countDate = countDate;
        this.hisStock = hisStock;
        this.modifyDate = System.currentTimeMillis();
        this.sale = 0;
        this.stock = 0;
        this.userID = userID;
    }

    public SaleStockDailyReport(String commodityTerminalID, String commodityTerminalName, Integer stock, Long countDate, String userID) {
        this.saleStockDailyReportID = Identities.uuid2();
        this.ask = 0;
        this.commodityTerminalID = commodityTerminalID;
        this.commodityTerminalName = commodityTerminalName;
        this.countDate = countDate;
        this.hisStock = 0;
        this.modifyDate = System.currentTimeMillis();
        this.sale = 0;
        this.stock = stock;
        this.userID = userID;
    }

    public SaleStockDailyReport(String commodityTerminalID, String commodityTerminalName, Long countDate, Integer sale, String userID) {
        this.saleStockDailyReportID = Identities.uuid2();
        this.ask = 0;
        this.commodityTerminalID = commodityTerminalID;
        this.commodityTerminalName = commodityTerminalName;
        this.countDate = countDate;
        this.hisStock = 0;
        this.modifyDate = System.currentTimeMillis();
        this.sale = sale;
        this.stock = 0;
        this.userID = userID;
    }
}